const handlebars = require("handlebars");

// 模板 => 循环
const template = `
  <ul>
    {{#each list}}
      <li>{{this}}</li>
    {{/each}}
  </ul>
`;
// 上下文对象
const context = {
  list: ["a", "b", "c"],
};
// 编译模板
const compiled = handlebars.compile(template);
// 渲染模板
const result = compiled(context);
console.log(result);
